var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var r, a = arguments.length, i = a < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n); else for (var s = t.length - 1; 0 <= s; s--) (r = t[s]) && (i = (a < 3 ? r(i) : 3 < a ? r(e, o, i) : r(e, o)) || i);
    return 3 < a && i && Object.defineProperty(e, o, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameConfig"), s = e("AdManager"), c = e("UIManager"), l = e("Global"), d = e("TemplateCustomAd"), u = cc._decorator, p = u.ccclass, h = u.property, f = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.auto = !0, t.tag = "base", t;
    }
    return i(t, e), t.prototype.start = function() {
        this.auto && this.doInit();
    }, t.prototype.doInit = function() {
        var t, e;
        r.GC.isVaild(this.tag + "_banner") ? this.node.destroy() : l.G.isBanner(this.tag) ? (s.default.getInstance().showBanner(this.tag), 
        this.node.destroy()) : GA.isWeChat() && l.G.isGuide(this.tag) || ((e = (t = new cc.Node()).addComponent(d.default)) && (e.tag = this.tag, 
        e.bindView = c.default.getInstance().getPnl(this.tag), e.bindView && t.setParent(e.bindView.node)), 
        this.node.destroy());
    }, a([ h ], t.prototype, "auto", void 0), a([ h ], t.prototype, "tag", void 0), 
    a([ p ], t);
}(cc.Component);

n.default = f;